import { Decorator_DtoIsNumber_Base } from '@/common/decorators/dtoIsNumber';
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsOptional } from 'class-validator';

export class CouponUserClient_Create_Dto {
  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  @ApiProperty({ description: '优惠券Id' })
  couponId: number;

  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  @ApiProperty({ description: '用户Id' })
  userClientId: number;

  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  @ApiProperty({ description: '开始时间', type: 'bigint' })
  fixedTimeStart: number;

  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  @ApiProperty({ description: '结束时间', type: 'bigint' })
  fixedTimeEnd: number;
}

export class CouponUserClient_Find_Dto {
  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  size?: number;

  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  page?: number;

  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  @ApiProperty({ description: '优惠券Id' })
  couponId: number;
}

export class CouponUserClient_Update_Dto {
  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  id: number;

  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  @ApiProperty({ description: '结束时间' })
  fixedTimeEnd: number;
}
